Fixes unsaved changes prompt on unchanged settings (#8230).#11300
Fixes unsaved changes prompt on unchanged settings (#8230).#11300robertjmcintyre wants to merge 2 commits intoRooCodeInc:mainfrom
Conversation
Re-reviewed after merge from main (4570ad5). The merge brought only unrelated changes (Vertex/Gemini prop simplification, sidebar icon reordering). The PR's fix is unchanged and correct. No issues found. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote fix failing tests |
Fixed the failing CI checks by merging |
|
@roomote Are you able to re-run the failing checks? They're likely due to the merge as well. |
Merged |
|
@roomote Investigate the remaining failing test. The test that's failing should not be impacted by this change and was passing when running locally. |
Fixed the flaky |
|
@roomote run the failing check again now that you’ve fixed the test |
Ran webview tests locally -- all 120 test files pass (1249 tests, 8 skipped). The Windows CI failure was flaky. Pushed an empty commit to re-trigger CI. |
Related GitHub Issue
Closes: # #8230
Roo Code Task Context (Optional)
N/A
Description
Root Cause
The issue is caused by automatic header synchronization in the OpenAI Compatible provider settings. Two separate components (
ApiOptionsandOpenAICompatible) manageopenAiHeadersstate and automatically sync it back to the configuration. When components mount/remount:customHeadersstate initializes with a new array/object reference (even if content is identical)setApiConfigurationField("openAiHeaders", ...)without marking them as non-user actionsSolution
Three changes are required to fix this issue:
Without all three changes, the bug would persist because:
isUserAction: false, syncing{}→{}would trigger change detection since they have different object referencesTest Procedure
Unit Tests - All active unit tests passing
@roo-code/build:test: Test Files 1 passed (1)
@roo-code/build:test: Tests 1 passed (1)
@roo-code/vscode-shim:test: Test Files 22 passed (22)
@roo-code/vscode-shim:test: Tests 407 passed (407)
@roo-code/telemetry:test: Test Files 1 passed (1)
@roo-code/telemetry:test: Tests 31 passed (31)
@roo-code/types:test: Test Files 9 passed (9)
@roo-code/types:test: Tests 166 passed (166)
@roo-code/cloud:test: Test Files 14 passed (14)
@roo-code/cloud:test: Tests 270 passed (270)
@roo-code/cli:test: Test Files 24 passed | 1 skipped (25)
@roo-code/cli:test: Tests 399 passed | 1 skipped (400)
@roo-code/vscode-webview:test: Test Files 118 passed (118)
@roo-code/vscode-webview:test: Tests 1245 passed | 8 skipped (1253)
@roo-code/core:test: Test Files 9 passed (9)
@roo-code/core:test: Tests 140 passed (140)
roo-cline:test: Test Files 368 passed | 4 skipped (372)
roo-cline:test: Tests 5340 passed | 47 skipped (5387)
Manual Testing
NOTE: This only happens with the OpenAI Compatible API Provider selected.
Current Behavior
Fixed Behavior
Pre-Submission Checklist
Screenshots / Videos
None
Documentation Updates
Additional Notes
Again, this only happens in the OpenAI Compatible API Provider case.
Get in Touch
AbsenceOfSound
Important
Fixes unsaved changes prompt in settings by marking automatic header syncs as non-user actions and enhancing change detection logic.
ApiOptions.tsxandOpenAICompatible.tsx.SettingsView.tsxto skip automatic syncs with semantically equal values.setApiConfigurationFieldinApiOptions.tsxandOpenAICompatible.tsxto includeisUserActionparameter.areValuesEqualhelper inSettingsView.tsxfor deep comparison of objects/arrays.This description was created by
for cc47997. You can customize this summary. It will automatically update as commits are pushed.